package com.woniu.mapper;

import com.woniu.pojo.Admin;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author zhaolei
 * @date 2021/4/11 - 20:02
 */
@Mapper
public interface AdminMapper {
    @Insert("INSERT INTO admin(NAME,PASSWORD,age,telephone) VALUES(#{name},#{password},#{age},#{telephone})")
    public void addUser(Admin admin);
    @Delete("DELETE FROM admin WHERE id=#{id}")
    public void deleteUser(int id);
    @Update("UPDATE admin SET NAME=#{name},age=#{age} WHERE id=#{id}")
    public void updateUser(Admin admin);
    @Select("SELECT * FROM admin")
    public List<Admin> selectAll();
}
